"""
Web Service Endpoint...
"""
# twisted support
from twisted.web import static
from twisted.python import log
from pspy.gear.cfg import pspyConf

# pspyder support
from pspy.der import StaticWebService, ActionDomainService

##
# create the wrapper site as a static
# service with active children...
class PspySite(StaticWebService):
	"Main application services"	
	def __init__(self):
		
		# establish static content
		StaticWebService.__init__(self, rootFlag=1, crcAuto=['/'], crcDelay=3)
		self.putChild('', static.File('./html/index.html'))

		# add in Worx services
		for nm, pth in pspyConf.services.items():
			print 'processing %s,%s' % (nm, pth)
			self.addActionDomain(nm, actionRoot='./app/%s/actions' % pth)
			
